package com.zhaorui.form;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PrizeAddForm {
    /**
     * 奖品名称
     */
    @NotEmpty(message = "奖品名称不能为空")
    private String prizeName;

    /**
     * 图片
     */
    @NotEmpty(message = "图片不能为空")
    private String prizePic;
    /**
     * 简介：说明
     */
    @NotEmpty(message = "简介不能为空")
    private String prizeExplain;

    /**
     * 价格1
     */
    @NotNull(message = "价格不能为空")
    @DecimalMax (value = "100000")
    private BigDecimal prizePrice;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private Date createtime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updattime;

    /**
     * 逻辑删除：0：正常；1：停用
     */
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer del;
}
